<template>
  <div class="barnd">
    <div class="brand_title">品牌制造商直供</div>
    <ul>
      <li class="brand_li" v-for="item in brandListarr" :key="item.new_sort_order">
        <h4>{{item.name}}</h4>
        <p>￥{{item.floor_price | priceFilter}}元</p>
        <img :src="item.pic_url" alt />
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["brandListarr"],
  filters: {
    // 价格过滤器，所有价格保留两位小数
    priceFilter(money) {
      return money.toFixed(2);
    }
  }
};
</script>

<style lang="less">
.barnd {
  background-color: #fff;
  margin-bottom: 10px;
  .brand_title {
    text-align: center;
    height: 50px;
    line-height: 50px;
  }
  ul {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .brand_li {
      width: 49.5%;
      height: 126px;
      margin-bottom: 5px;
      position: relative;
      h4 {
        font-weight: normal;
        position: absolute;
        left: 5%;
        top: 10px;
        margin: 0;
      }
      p {
        position: absolute;
        left: 5%;
        top: 20px;
        color: #666;
        font-size: 14px;
      }
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>